Time in Status Function
The timeInStatus function allows you to find issues that have spent a specific amount of time in a given status. This is useful for tracking how long issues remain in particular workflow states.
📖 Complete Guide Available: For comprehensive documentation including the Time in Status custom field, timeExpression function, and setup instructions, see Time in Status Field and timeExpression Function.
Syntax​
issue [operator] timeInStatus("subquery", "status", "time expression")
Parameters​
subquery(required): A valid JQL query that defines the set of issues to evaluate.status(required): The name of the status to track. The function will validate this against available statuses in your Jira instance.time expression(required): A time expression in the format of2w 3d 5h 4mwhere:wrepresents weeksdrepresents dayshrepresents hoursmrepresents minutessrepresents seconds
operatorare mathematical operators such as>,>=,=,!=,<,<=
Examples​
Find issues that have spent more than 2 weeks in the "In Progress" status:
issue > timeInStatus("project = ABC", "In Progress", "2w")
Find issues that have spent less than 3 days in the "To Do" status:
issue < timeInStatus("project = ABC", "To Do", "3d")
Find issues that have spent exactly 5 hours in the "In Review" status:
issue = timeInStatus("project = ABC", "In Review", "5h")
Find issues that have spent at least 2 weeks and 3 days in the "Blocked" status:
issue >= timeInStatus("project = ABC", "Blocked", "2w 3d")
Notes​
- The function processes issues in batches of 100 to optimize performance
- There is a limit of 2000 issues that can be processed in a single query
- The time calculation includes the current time if the issue is still in the specified status
- The function supports all standard comparison operators:
>,>=,=,<,<= - Time is calculated based on the issue's changelog history
- If an issue has no status transitions, the function will check if its current status matches the specified status and calculate time from the issue's creation date
Error Messages​
- "Invalid status: [error message]" - When the specified status is not valid
- "Invalid time expression: [error message]" - When the time expression format is incorrect
- "Subquery matches [count] issues which exceeds the limit of 2000" - When too many issues are matched by the subquery
- "Unsupported operator: [operator]" - When an unsupported comparison operator is used